<template>
	<view>
		<u-tabbar :value="value" @change="change" :fixed="true" :placeholder="true" :safeAreaInsetBottom="true">
			<u-tabbar-item :name="index" :text="item.text" :icon="item.icon" v-for="(item,index) in tabBarList">
			</u-tabbar-item>
		</u-tabbar>
	</view>
</template>
<script>
	import store from '@/store'
	export default {
		data() {
			return {
				// value: 0,
				borderTop: true,
				inactiveColor: '#909399',
				activeColor: '#328CFA',
				tabBarList: uni.getStorageSync('tabBarList')
			}
		},
		methods: {
			change(index) {
				if (index == 0) {
					uni.switchTab({
						url: this.tabBarList[index].pagePath
					})
				} else {
					uni.navigateTo({
						url: this.tabBarList[index].pagePath
					})
				}

			}
		},
		props: {
			value: {
				default: 0
			}
		}

	}
</script>
